/*
 * Copyright(c) 2017-2019, 北京希为科技有限公司
 * Beijing Xiwei Technology Co., Ltd.
 * All rights reserved.
 *
 * ###############################################################
 * revision             author            reason             date
 *
 *
 * ###############################################################
 */
package io.gitee.jaemon.spring.adorner.demo.entity;

import com.fasterxml.jackson.annotation.JsonInclude;


/**
 * Response
 *
 * @author Jaemon
 * @since 1.0
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Response<T> {
    /**
     * 响应码
     * */
    private Integer code;

    /**
     * 详细描述
     * */
    private String message;

    /**
     * 响应数据
     * */
    private T data;

    private Response(Integer code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static <T> Response success(T data) {
        return new Response<>(200, "success", data);
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}